# coding=utf-8
# 遍历所有文件名并输出
import os
import pandas as pd

filePath = 'D:\\dx\\img'

list = []

for i, j, k in os.walk(filePath):
    # print(k)
    for s in k:
        print(s[0:-4])
        list.append(s[0:-4])

column = ['msg']
test = pd.DataFrame(columns=column, data=list)
test.to_csv('D:/mgs_9_10.csv')